package com.eastmoney.emis.edda.infrastructure.fund;

import com.eastmoney.emis.edda.domain.entity.EddiInstruction;
import com.eastmoney.emis.edda.domain.valueobject.MoneyType;
import com.eastmoney.emis.edda.domain.valueobject.TimeFormatter;
import com.eastmoney.emis.edda.infrastructure.util.CutoffTimeUtils;
import com.eastmoney.emis.utils.common.utils.RequestUtil;

import java.time.LocalDate;

/**
 * @description: Description
 * @projectName: EDDA-HSBC
 * @package: com.eastmoney.emis.edda.infrastructure.fund
 * @author: 汪程程
 * @date: 2022/10/14 2:19 PM
 * @version: 1.0
 */
public class FundDepositReq {
    private String hkcuaccId;
    private String opStation;
    private String moneyType;
    private String feeMoneyType;
    private String occurBalance;
    private String valueDate;
    private String remark;
    private String bankId;
    private String bankAccount;
    private String requestId;

    public FundDepositReq() {
    }

    public FundDepositReq(EddiInstruction eddiInstruction) {
        this.setHkcuaccId(eddiInstruction.getClientId());
        this.setOpStation(RequestUtil.getServerIp());
        this.setFeeMoneyType(eddiInstruction.getMoneyType());
        this.setMoneyType(eddiInstruction.getMoneyType());
        this.setOccurBalance(eddiInstruction.getOccurBalance().toString());
        this.setRemark(eddiInstruction.getRemark());
        this.setRequestId(eddiInstruction.getApplySerialNo());

        LocalDate date = LocalDate.now();
        if(CutoffTimeUtils.isCutoffTime()) {
            date = date.plusDays(1);
        }
        this.valueDate = date.format(TimeFormatter.YYYYMMDD);
    }


    public String getHkcuaccId() {
        return hkcuaccId;
    }

    public void setHkcuaccId(String hkcuaccId) {
        this.hkcuaccId = hkcuaccId;
    }

    public String getOpStation() {
        return opStation;
    }

    public void setOpStation(String opStation) {
        this.opStation = opStation;
    }

    public String getMoneyType() {
        return moneyType;
    }

    public void setMoneyType(String moneyType) {
        this.moneyType = moneyType;
    }

    public String getFeeMoneyType() {
        return feeMoneyType;
    }

    public void setFeeMoneyType(String feeMoneyType) {
        this.feeMoneyType = feeMoneyType;
    }

    public String getOccurBalance() {
        return occurBalance;
    }

    public void setOccurBalance(String occurBalance) {
        this.occurBalance = occurBalance;
    }

    public String getValueDate() {
        return valueDate;
    }

    public void setValueDate(String valueDate) {
        this.valueDate = valueDate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getBankId() {
        return bankId;
    }

    public void setBankId(String bankId) {
        this.bankId = bankId;
    }

    public String getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }
}
